home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_pcdp / ada / matrixl.ada < prev    next >
Text File  |  1996-01-30  |  859b  |  31 lines

  1. with Text_IO; use Text_IO;
  2. with Tuple_Defs; use Tuple_Defs;
  3. with Tuple_Package; use Tuple_Package;
  4. procedure MatrixL is
  5.  
  6.   Result: Tuples;
  7.  
  8.   task type Workers;
  9.   Worker: array(1..2) of Workers;
  10.   task body Workers is separate;
  11.  
  12. begin
  13.   Out_Tuple(Char('A'), Int(1), Vec((1,2,3)));
  14.   Out_Tuple(Char('A'), Int(2), Vec((4,5,6)));
  15.   Out_Tuple(Char('A'), Int(3), Vec((7,8,9)));
  16.   Out_Tuple(Char('B'), Int(1), Vec((1,0,1)));
  17.   Out_Tuple(Char('B'), Int(2), Vec((0,1,0)));
  18.   Out_Tuple(Char('B'), Int(3), Vec((2,2,0)));
  19.  
  20.   Out_Tuple(Char('N'), Int(1));
  21.  
  22.   Put_Line("  Row    Col   Result");
  23.   for I in 1..3 loop
  24.     for J in 1..3 loop
  25.       Result := In_Tuple(Char('C'), Int(I), Int(J), Formal_Int);
  26.       Put_Line(Integer'Image(I) & Integer'Image(J) &
  27.                Integer'Image(Int(Result,4)));
  28.     end loop;
  29.   end loop;
  30. end MatrixL;
  31.